<layout name="layout" />
<!-- 搜索 -->
<div class="form-div search_form_div">
    <form action="__ACTION__" method="GET" name="search_form">
		<p>
			课程名：
			{:buildSelect('course','course_id','id','course_name');}
		</p>
		<p>
			会员ID：
	   		<input type="text" name="member_id" size="30" value="<?php echo I('get.member_id'); ?>" />
		</p>
		<p>
			预约电话：
	   		<input type="text" name="yueyu_tel" size="30" value="<?php echo I('get.yueyu_tel'); ?>" />
		</p>
		<p>
			预约名字：
	   		<input type="text" name="yueyu_name" size="30" value="<?php echo I('get.yueyu_name'); ?>" />
		</p>
		<p>
			预约时间：
	   		从 <input class="form-control datetimepicker" id="start_time_from" type="text" name="start_timefrom" size="15" value="<?php echo I('get.start_timefrom'); ?>" />
		    到 <input class="form-control datetimepicker" id="start_time_to" type="text" name="start_timeto" size="15" value="<?php echo I('get.start_timeto'); ?>" />
		</p>
		<p><input type="submit" value=" 搜索 " class="button" /></p>
    </form>
</div>
<!-- 列表 -->
<div class="list-div" id="listDiv">
	<table cellpadding="3" cellspacing="1">
    	<tr>
            <th >课程名</th>
            <th >会员名</th>
            <th >预约电话</th>
            <th >预约名字</th>
            <th >预约备注</th>
            <th >预约时间</th>
			<th width="200">操作</th>
        </tr>
		<?php foreach ($data as $k => $v): ?>            
			<tr class="tron">
				<td height="60"><?php getIdByName('course',$v['course_id'],'course_name'); ?></td>
				<td>
					<php>
						if(empty($v['member_id']))
						echo '散客';
						else
						getIdByName('yujia_member',$v['member_id'],'name');

					</php>
				</td>
				<td><?php echo $v['yueyu_tel']; ?></td>
				<td><?php echo $v['yueyu_name']; ?></td>
				<td><?php echo $v['yueyu_comment']; ?></td>
				<td><?php echo $v['yueyu_time']; ?></td>
		        <td align="center">
		        	<a href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p')); ?>" title="编辑">编辑</a> |
	                <a href="<?php echo U('delete?id='.$v['id'].'&p='.I('get.p')); ?>" onclick="return confirm('确定要删除吗？');" title="移除">移除</a> 
		        </td>
	        </tr>
        <?php endforeach; ?> 
		<?php if(preg_match('/\d/', $page)): ?>  
        <tr><td align="right" nowrap="true" colspan="99" height="30"><?php echo $page; ?></td></tr> 
        <?php endif; ?> 
	</table>
</div>
<script src="__PUBLIC__/Common/html/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script>
	$(document).ready(function () {
        $(".datetimepicker").datepicker();
    })

</script>